﻿using docNET.Common;

namespace docNET
{
	/// <summary>
	/// Holds internal current fields.
	/// </summary>
	internal static class Current
	{
		#region Properties
		/// <summary>
		/// Current project (or null if no project loaded).
		/// </summary>
		internal static Project project { get; set; }

		/// <summary>
		/// Show exceptions in messages.
		/// </summary>
		internal static bool showExceptions { get; set; }

		/// <summary>
		/// Default folder for saving projects.
		/// </summary>
		internal static string defaultProjectFolder { get; set; }

		/// <summary>
		/// Current item, for shoing menus etc.
		/// </summary>
		internal static string item { get; set; }
		#endregion

		#region Methods
		internal static void Refresh()
		{
			var settings = docNET.Properties.Settings.Default;
			settings.Reload();
			showExceptions = settings.ShowExceptions;
			defaultProjectFolder = settings.DefaultProjectPath;
		}
		#endregion
	}
}
